<!--健康评估页-->
<template>
  <div style="height: 6vh;background-color:#fff;padding:10px 20px;">
    <span style="line-height:60px;font-size:20px;">消费提醒</span>
    <el-button type="primary" style="float:right;margin-top:13px;" @click="addHealth">健康评估</el-button>
  </div>
  <!-- 健康评估弹窗 -->
  <el-dialog title="健康评估" v-model="addApplicationDialogVisible" style="width:1000px;padding:40px;">
    <el-form label-width="80px" label-position="top">
      <el-row :gutter="30">
        <el-col :span="12">
          <el-form-item label="评估人姓名">
            <el-input readonly placeholder="评估人姓名"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="老人姓名">
            <el-input placeholder="请输入老人姓名"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="12">
          <el-form-item label="老人身份证号">
            <el-input placeholder="请输入老人身份证号"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="老人性别">
            <el-select placeholder="请选择老人性别">
              <el-option label="男" value="1"></el-option>
              <el-option label="女" value="0"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="12">
          <el-form-item label="老人年龄">
            <el-input placeholder="请输入老人年龄"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="评估时间">
            <el-date-picker format="YYYY-MM-DD"
                            value-format="YYYY-MM-DD"/>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="老人监督人">
            <el-input readonly placeholder="老人监督人"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="12">
          <el-form-item label="评估结果">
            <el-select placeholder="请选择老人评估结果">
              <el-option label="未评估" value="0"></el-option>
              <el-option label="轻度失能" value="10"></el-option>
              <el-option label="中度失能" value="20"></el-option>
              <el-option label="重度失能" value="30"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="评估状态">
            <el-select placeholder="请选择老人评估状态">
              <el-option label="未评估" value="0"></el-option>
              <el-option label="以评估" value="10"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button>取消</el-button>
      <el-button type="primary" @click="saveRepair">录入</el-button>
    </template>
  </el-dialog>

  <!-- 健康评估 搜索卡片 -->
  <!--  第一行-->
  <el-card style="margin: 20px;">
    <el-form style="padding-top:10px;">
      <el-row :gutter="30">
        <el-col :span="8">
          <el-form-item label="姓名">
            <el-input placeholder="请输入老人姓名"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="评估时间">
            <el-date-picker type="date" format="YYYY-MM-DD"
                            value-format="YYYY-MM-DD"/>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item>
            <el-button @click="resetForm">重置</el-button>
            <el-button type="primary" @click="selectDict">查询</el-button>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </el-card>
  <!-- 健康评估表格 -->
  <el-card style="margin:20px">
    <el-table :data="healthForm">
      <el-table-column type="index" width="80" align="center" prop="id" label="编号"></el-table-column>
      <el-table-column align="center" prop="username" label="老人姓名"></el-table-column>
      <el-table-column align="center" prop="num" label="身份证号"></el-table-column>
      <el-table-column align="center" prop="gender" label="性别"></el-table-column>
      <el-table-column align="center" prop="age" label="年龄"></el-table-column>
      <el-table-column align="center" prop="empId" label="评估员"></el-table-column>
      <el-table-column align="center" prop="assessmentTime" label="评估时间"></el-table-column>
      <el-table-column align="center" prop="assessmentResult" label="评估结果"></el-table-column>
      <el-table-column align="center" prop="assessmentState" label="评估状态"></el-table-column>
      <el-table-column label="操作" width="120" align="center">
        <template #default="scope">
          <el-button type="primary" size="small" link>编辑</el-button>
          <el-button type="primary" size="small" link>删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>
<script setup>
import {onMounted, ref} from "vue";
import axios from '@/util/request';
import qs from "qs";
import {ElMessage} from "element-plus";
//定义变量控制创建申请单弹窗是否出现
const addApplicationDialogVisible = ref(false);
//查询出的表单数据
const healthForm = ref([]);
//新增健康监测表单


</script>
<style scoped>

</style>